// This do-file extracts data on GDP per capita growth from the Penn World Tables

use "$project_path/data/1_input/outcomes/pwt/pwt90.dta", clear

ren country Country
ren year Year
sort Country Year

keep Country Year pop rgdpna

egen country_id = group(Country)
xtset country_id Year

gen gdpc_penn =  rgdpna/pop
gen growth_gdpc_penn = 100*(gdpc_penn-L.gdpc_penn)/L.gdpc_penn

replace Country="Bolivia"  if Country=="Bolivia (Plurinational State of)"
replace Country="Bosnia-Herz"  if Country=="Bosnia and Herzegovina"
replace Country="Virgin Islands, British"  if Country=="British Virgin Islands"
replace Country="Brunei"  if Country=="Brunei Darussalam"
replace Country="C. Verde Is."  if Country=="Cabo Verde"
replace Country="Cent. Af. Rep."  if Country=="Central African Republic"
replace Country="PRC"  if Country=="China"
replace Country="Comoro Is."  if Country=="Comoros"
replace Country="Curacao"  if Country=="Curaçao"
replace Country="Czech Rep."  if Country=="Czech Republic"
replace Country="Ivory Coast"  if Country=="Côte d'Ivoire"
replace Country="Congo (DRC)"  if Country=="D.R. of the Congo"
replace Country="Dom. Rep."  if Country=="Dominican Republic"
replace Country="Eq. Guinea"  if Country=="Equatorial Guinea"
replace Country="FRG/Germany"  if Country=="Germany"
replace Country="Iran"  if Country=="Iran (Islamic Republic of)"
replace Country="Laos"  if Country=="Lao People's DR"
replace Country="Korea, Republic of"  if Country=="Republic of Korea"
replace Country="Moldova"  if Country=="Republic of Moldova"
replace Country="Russia"  if Country=="Russian Federation"
replace Country="St. Lucia"  if Country=="Saint Lucia"
replace Country="Sint Maarten"  if Country=="Sint Maarten (Dutch part)"
replace Country="S. Africa"  if Country=="South Africa"
replace Country="Saint Vincent and The Grenadines"  if Country=="St. Vincent and the Grenadines"
replace Country="Occupied Palestinian Territories"  if Country=="State of Palestine"
replace Country="Syria"  if Country=="Syrian Arab Republic"
replace Country="Macedonia"  if Country=="TFYR of Macedonia"
replace Country="Trinidad-Tobago"  if Country=="Trinidad and Tobago"
replace Country="Tanzania"  if Country=="U.R. of Tanzania: Mainland"
replace Country="UAE"  if Country=="United Arab Emirates"
replace Country="UK"  if Country=="United Kingdom"
replace Country="USA"  if Country=="United States"
replace Country="Venezuela"  if Country=="Venezuela (Bolivarian Republic of)"
replace Country="Vietnam"  if Country=="Viet Nam"
drop if Country=="China, Hong Kong SAR"
drop if Country=="China, Macao SAR"
drop if Country=="Sudan (Former)"

keep Country Year growth_gdpc_penn
lab var growth_gdpc_penn "GDP per capita growth"
notes growth_gdpc_penn : Source - Penn World Tables

save "$project_path/data/2_intermediary/outcomes/outcomes_pwt.dta", replace
